<?php

require_once dirname(__FILE__) . '/bdd_conf.php';

abstract class BaseDAO{

	protected $connection;

	public static function getConnection(){
		try{
			if($this->connection == NULL){
				$this->connection = new PDO(
			'mysql:host=' . $dbHost . ';
			 port=' . $dbPort . ';
			 dbname=' . $dbName,
				$dbLogin,
				$dbPassword);
			}
			return $this->connection;
		}catch (Exception $e){
				throw new Exception("Problème lors de la
				connexion à la base de donnée\n" .
				$e->getMessage());
		}
	}

}